import request from '@/utils/request'

// 获取组织架构列表
export function getDepartmentsList() {
  return request({
    url: '/company/department'
  })
}

// 删除部门
export function removeDepartments(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}

// 新增部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 根据id获取部门详情
export function getDepartmentsById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}

// 根据id进行部门编辑
export function editDepartmentsById(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}
